<?php
abstract class BaseController 
{
	protected $controller;
	protected $param;
	protected $action;
	
	public function __construct($controller, $action, $param=null) 
    {
		$this->controller = $controller;
    	$this->action = $action;
		$this->param = $param;
	}
    
	public function ExecuteAction() 
    {
    	$this->{$this->action}();
    }
    
	protected function ReturnView($modeldata) 
    {
        $viewFileName = 'views/' . $this->controller . '/view.php';
        
        // folder 'content' is in include path
        // these two variables are available in the returned view
        $bodyContentFileName = $this->controller . '/' . $this->action . '_bodyContent.php';
        $headContentFileName = $this->controller . '/' . $this->action . '_headContent.php';
        
        require($viewFileName);
	}
}